package API

import (
	"net/http"
	"server/framework/API/R"
	"server/lib/Imartini"
	// "encoding/json"
	t "server/web/model/test"
)

/*
type:版本号
name:接口名称
bewrite:接口描述
field:product,产品id,备注:参数名称,参数说明,备注:
return:200,成功,:返回值,返回说明,
returncode:200,成功,:返回值,返回说明,
*/

var V2testdoc = map[string]interface{}{
	"type":    "V2",
	"url":     "/test",
	"name":    "接口名称",
	"bewrite": "接口描述",
	"field": map[string]interface{}{
		"name": []string{"value", "备注"},
		"参数名":  []string{"参数值", "备注"},
	},
	"return": map[string]interface{}{
		"返回值名称": []string{"返回值说明", "备注"},
	},
	"returncode": map[string]interface{}{
		"返回代码名称": []string{"返回代码说明", "备注"},
	},
}

func V2test(res http.ResponseWriter, g Imartini.G) error {
	ret, _ := t.Testdb()
	return R.Write(res, g, map[string]interface{}{
		"status":  "200",
		"type":    "V2",
		"message": "",
		"data":    ret[1],
	})
}
